{% macro helpcategory_tree(categorys) %}
    {% if categorys is not empty %}
    <ol class="dd-list">
        {% for category in categorys %}
            <li class="dd-item dd-collapsed" data-id="{{ category['id'] }}">
                <div class="dd-handle">
                    <strong>{{ category['name']|raw }}</strong>
                    <span class="pull-right dd-nodrag">
                {% if is_authorized('admin_cms_help_category_edit') %}
                    <a href="{{ path("admin_cms_help_category_edit", {"id":category['id']}) }}" data-title="编辑"  class="poppage"><i class="mdi mdi-file-document-edit"></i></a>
                {% endif %}
                        {% if is_authorized('admin_api_cms_help_category_delete') %}
                            <a href="{{ path("admin_api_cms_help_category_delete", {"id":category['id']}) }}"  data-confirm="确认要删除吗?" class="tree_branch_delete ajaxDelete"><i class="mdi mdi-delete"></i></a>
                        {% endif %}
                </span>
                </div>
                {{ _self.helpcategory_tree(category['childs']) }}
            </li>
        {% endfor %}
    </ol>
    {% endif %}
{% endmacro %}
